package gamebackend;


/**
 * Maintains the target and child for subclasses.
 * @author Jonathan Caddey
 */
public abstract class AbstractFlier implements Flier {
	private double my_target;
	private final Flier my_child;

	protected AbstractFlier(final Flier the_child) {
		my_child = the_child;
	}
	
	protected AbstractFlier() {
		my_child = null;
	}
	
	@Override
	public void step(final double the_yChange) {
		my_child.step(the_yChange);
	}
	
	@Override
	public void setTarget(final double the_target) {
		my_target = the_target;
	}
	
	@Override
	public double getTarget() {
		return my_target;
	}
	
	@Override
	public boolean isAtTarget() {
		throw new UnsupportedOperationException();
	}
	
	@Override
	public Flier getChild() {
		return my_child;
	}
	
	@Override
	public double getPosition() {
		return my_child.getPosition();
	}
	
	
}
